<template>
  <div id="app">
    <el-container id="mainContainer">
      <el-header :height="headerHeight + 'px'" id="mainHeader">
        <div class="logo">
          <img src="@/assets/logo.png" />
        </div>
        <info></info>
      </el-header>
      <el-container>
        <el-aside :style="getSideSize()">
          <sideNav />
        </el-aside>
        <el-main>
          <BreadscrumNav></BreadscrumNav>
          <router-view id="subContainer" />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import sideNav from '@/components/SideNav'
import Info from '@/components/Info'
import BreadscrumNav from '@/components/BreadcrumbNav'

export default {
  name: 'app',
  components: {
    sideNav,
    Info,
    BreadscrumNav
  },
  data () {
    return {
      headerHeight: 64,
      sideWidth: 200,
      userName: 'username'
    }
  },
  methods: {
    getSideSize () {
      let sideWidth = this.sideWidth + 'px'
      let headerHeight = this.headerHeight + 'px'
      console.log(`width: ${sideWidth}; height: calc(100vh - ${headerHeight})`)
      return `width: ${sideWidth}; height: calc(100vh - ${headerHeight})`
    },
    getMainSize () {
      let mainHeight = this.headerHeight + 'px'
      return `height: calc(100vh - ${headerHeight})`
    }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}

body {
  background-color: #0b1021;
  margin: 0 0 0 0;
}

#mainContainer {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: hidden;
}

#mainHeader {
  width: 100%;
  background-color: #1a223c;
  padding: 0 0 0 0;
}

#subContainer {
  height: calc(100vh - 125px);
  overflow-x: hidden;
  overflow-y: scroll;
}

#subContainer::-webkit-scrollbar {
  width: 5px;
}

#subContainer::-webkit-scrollbar-thumb {
  background: rgb(0, 170, 255, 0.5);
  border-radius: 10px;
}

#subContainer::-webkit-scrollbar-track {
  background: #13192c;
  border-radius: 2px;
}

.el-aside {
  background-color: #13192c;
  color: #333;
  text-align: left;
}

.el-main {
  background-color: #0b1021;
  color: #333;
}

#app .el-input__inner,
.el-date-editor .el-range-input {
  background: transparent;
  border: 1px solid #1d3a7f;
}

/* 	BreadscrumNav {
		position: relative;
		top: 21px;
		left: 20px;
	} */

.logo {
  position: relative;
  left: 34px;
  top: 20px;
  float: left;
}

#app .info {
  color: rgba(255, 255, 255, 0.6);
}
</style>
